﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SCG.General
{
    public class Path
    {
        //constructor
        public Path(PathFinder pf)
        {
            _pf = pf;
        }
        public Path(PathFinder pf, SCGPoint zone, Path p)
        {
            _pf = pf;
            _zones = new List<SCGPoint>(p.Zones);
            int cost = pf.Region.CostFrom(LastZone, zone);
            Cost = p.Cost + cost;
            _zones.Add(zone);
        }

        //public properties
        public int Cost { get; set; }

        public List<SCGPoint> Zones
        {
            get
            {
                return _zones;
            }
        }

        public SCGPoint LastZone
        {
            get
            {
                return _zones[_zones.Count - 1];
            }
        }

        //private members
        private PathFinder _pf;
        private List<SCGPoint> _zones = new List<SCGPoint>();
    }
}
